import 'package:flutter/material.dart';
import 'package:flutter_shop/pages/home/tab_search/dataList.dart';
import 'package:flutter_shop/widgets/room_list_item_widget.dart';
import 'package:flutter_shop/widgets/search_bar/index.dart';

class TabSeatch extends StatefulWidget {
  @override
  State<TabSeatch> createState() => _TabSeatchState();
}

class _TabSeatchState extends State<TabSeatch> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: SearchBar(
            showLoaction: true,
            showMap: true,
            onSearch: () {
              Navigator.of(context).pushNamed('search');
            }),
        backgroundColor: Colors.white,
      ),
      body: Column(
        children: [
          Container(
            margin: EdgeInsets.only(top: 10, bottom: 10),
            height: 20,
            child: Text('标题'),
          ),
          Expanded(
              child: ListView(
            children: dataList
                .map((item) => Container(
                      height: 100,
                      margin: EdgeInsets.only(bottom: 10),
                      child: RoomListItemWidget(item),
                    ))
                .toList(),
          ))
        ],
      ),
    );
  }
}
